# Reference: <https://postmarketos.org/devicepkg>
# Maintainer: Adam Thiede <me@adamthiede.com>
# Co-Maintainer: Jenneron <jenneron@protonmail.com>
pkgname=device-google-oak
pkgdesc="Google Oak Chromebooks"
pkgver=8
pkgrel=0
url="https://postmarketos.org"
license="MIT"
arch="aarch64"
options="!check !archcheck"
depends="
	alsa-utils
	depthcharge-tools
	linux-postmarketos-mediatek-mt8173
	postmarketos-base
	postmarketos-cros-common
"
makedepends="devicepkg-dev"
source="deviceinfo modules-initfs"
subpackages="$pkgname-nonfree-firmware:nonfree_firmware"

# provides and replaces to switch old installations to this package
provides="google-elm=$pkgver-r$pkgrel google-hana=$pkgver-r$pkgrel"
replaces="google-elm google-hana"

build() {
	devicepkg_build $startdir $pkgname
}

package() {
	devicepkg_package $startdir $pkgname
}

nonfree_firmware() {
	pkgdesc="WiFi/BT and GPU firmware"
	depends="linux-firmware-mrvl linux-firmware-mediatek firmware-powervr-gx6250"
	mkdir "$subpkgdir"
}

sha512sums="
6e4c6704aaca2b157ca437d0c9575a7efb369934facc59d0e43cbfff103f2e98dca42a46ba332069f00cc8f1289355a2177cb2ca4627445d50be7daaad60d817  deviceinfo
4b0197eacfeeb4b13f5abc26950f570ee762742547674ce10110ccea63eb46630a2e3b5f87e9c9a1f9deda21baf05bec248ab7a65656687ec94d296b5657dafa  modules-initfs
"
